<?php 
global $header;
global $footer;
global $control;
global $message;
global $dictionary, $sources, $sources_imported;

global $featureManager;
$header['title'] = 'Sources of '.$dictionary['title'];
$header['head'] = '';
$header['intro'] = '<strong>QuickMerger</strong> is the way you make a dictionary oriented with source glossaries. First prepare your source glossaries, and you may then quickly and easily make your own dictionary with one click. After that, your dictionary is still editable &mdash; add/modify/remove a term or a definition in it, or even sort them. <a href="#">See more</a>. ';
$featureManager->apply("com.yizin.platform.site.header", $header);
$featureManager->apply("com.yizin.platform.site.footer", $footer);
$featureManager->apply("com.yizin.platform.site.control", $control);
?>
<?= $header['html']?>
<div class="container-L">
	<?=$control['html']?>
</div>
<div class="container-R">
	<?=Utils::showMessage($message)?>
	<form method="post" action="<?=REQUEST_BASE?>dictionary/<?=$dictionary['serial']?>/sources/">
		<h3>Choose sources</h3>
		<table class="sources">
			<col width="30"/>
			<col />
			<thead>
				<tr>
					<th></th><th scope="col">Source</th>
				</tr>
			</thead>
			<tbody>
			<?php $count=count($sources); for ($i=0;$i<$count;$i++) {?>
				<tr>
					<th scope="row">
						<input type="checkbox" name="sources[]" id="source<?=$i?>" class="checkbox" 
						value="<?=$sources[$i]['serial']?>" <?php if(in_array($sources[$i]['serial'], $sources_imported)) echo 'checked="checked"';?> />
					</th>
					<td>
						<label for="source<?=$i?>"><?=$sources[$i]['title']?></label>
					</td>
				</tr>
			<?php }?>
			</tbody>
			<tfoot>
				<tr>
					<th></th>
					<td><input type="submit" value="Update" class="button" /></td>
				</tr>
			</tfoot>
		</table>
	</form>
	<div class="vspacing"></div>
</div>
<?= $footer['html']?>
